package com.zxy.supplier_system.server.repository

import com.zxy.supplier_system.server.entity.MarketCheckInventoryRecordItem
import com.zxy.supplier_system.server.entity.SystemService
import org.springframework.data.domain.Page
import org.springframework.data.domain.Pageable
import org.springframework.data.jpa.repository.JpaRepository

@Suppress("FunctionName")
interface MarketCheckInventoryRecordItemRepository :
    JpaRepository<MarketCheckInventoryRecordItem, MarketCheckInventoryRecordItem.UnionId> {

    fun findAllByRecord_IdOrderBySequenceAsc(reocrd_id: Int, pageable: Pageable): Page<MarketCheckInventoryRecordItem>

    fun existsByRecord_IdAndGoods_Id(reocrd_id: Int, goods_id: Int): Boolean

    fun existsByRecord_IdAndGoods_Barcode(reocrd_id: Int, goods_barcode: String): Boolean;

    fun deleteByRecord_IdAndGoods_IdAndGoods_SystemService(
        record_id: Int,
        goods_id: Int,
        goods_systemService: SystemService
    )

}
